package Controller.largeScreen;


//import Dao.EldersDao;
import Dao.ElderMapper;
import Dao.EldersDao;
import Model.Elder;
import Service.ElderService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.SessionAttributes;

import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("/elder")
@SessionAttributes(value = {"id","lr_id", "lr_name","hg_id", "hg_name", "state","organization_name","f_sign", "t_sign","fwaddress" })


public class ElderController {
    private static final Logger elder = LoggerFactory.getLogger(ElderController.class);

    @Resource
    ElderService elderService;

//    @Autowired
//    ElderMapper elderMapper;

    @Autowired
    EldersDao elderDao;


    /**
     * 查询全部老人信息
     * @return
     */
    @RequestMapping("/FindAllElder")
    @ResponseBody
    public List<Elder> FindAllElder(){
//        System.out.println("Service: FindAllNews");
        List<Elder> res = null;
        try {
            res =elderDao.FindAllElder();
//            res =elderDao.FindAllElder();
        } catch (Exception e) {
            e.printStackTrace();
        }

        System.out.println("地图老人地址显示"+res);
//        System.out.println(getType(res));
        return res;
    }


}
